package main

import (
	"encoding/base64"
	"fmt"
)

// 应用级动态实体上传,需提前创建好music
func appid_entity_upload(entityName string){
	resName := fmt.Sprintf("%s.%s", RESNameSpace, entityName)

	data := base64.StdEncoding.EncodeToString([]byte(ENTITYDATA))

	pers_params := fmt.Sprintf("{appid:\"%s\"}", APPID)

	EntityUpload(resName, pers_params, data)
}

//用户级动态实体上传
func user_entity_upload(entityName string){
	resName := fmt.Sprintf("%s.%s", RESNameSpace, entityName)

	data := base64.StdEncoding.EncodeToString([]byte(ENTITYDATA))

	persParam := `{"auth_id":"c28dc1de995911e89eb6529269fb1459"}`

	EntityUpload(resName, persParam, data)
}

//自定义级动态实体上传
func udefine_entity_upload(entityName string){
	resName := fmt.Sprintf("%s.%s", RESNameSpace, entityName)

	data := base64.StdEncoding.EncodeToString([]byte(ENTITYDATA))

	// 这里key即为维度名称,值为该维度下的某个值
	persParam := `{"music_udefine":"13329041803"}`

	EntityUpload(resName, persParam, data)
}